home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
Xm
/
XmeNamesAreEqual.z
/
XmeNamesAreEqual
Wrap
Text File
|
1998-10-30
|
6KB
|
133 lines
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll((((3333XXXX))))
NNNNAAAAMMMMEEEE
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll - Compares two strings for equality
SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
#include <Xm/XmP.h>
BBBBoooooooolllleeeeaaaannnn XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll(
cccchhhhaaaarrrr ****iiiinnnn____ssssttttrrrr,
cccchhhhaaaarrrr ****tttteeeesssstttt____ssssttttrrrr);
VVVVEEEERRRRSSSSIIIIOOOONNNN
This page documents Motif 2.1.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll compares _i_n__s_t_r to _t_e_s_t__s_t_rand returns True
if they are equivalent. Typically, _i_n__s_t_rholds some Motif
constant, such as "Xm1000TH_INCHES" and _t_e_s_t__s_t_r holds a
normalized version of a constant, such as "1000th_inches".
The case of letters in _i_n__s_t_r is irrelevant. For comparison
purposes, XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll automatically converts all
letters in _i_n__s_t_r to lowercase. By contrast, all letters in
_t_e_s_t__s_t_r must be lowercase. If any letter in _t_e_s_t__s_t_r is
uppercase, then XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll automatically returns
False.
For example, if _i_n__s_t_r contains "Goodbye" and _t_e_s_t__s_t_r
contains "goodbye", XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll returns True (because
the function converts "Goodbye" to "goodbye"). However, if
_i_n__s_t_r contains "Goodbye" and _t_e_s_t__s_t_r contains "Goodbye",
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll returns False (because of the uppercase "G"
in _t_e_s_t__s_t_r).
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll treats the following prefixes specially:
_X_M, XXXXmmmm, xxxxMMMM, and xxxxmmmm. If one of these prefixes appears in
_i_n__s_t_r, XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll skips over it and begins the
comparison at the third character in _i_n__s_t_r. For example,
if _i_n__s_t_r contains "XMhello" and _t_e_s_t__s_t_rcontains "hello",
then XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll returns True. However,
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll provides no special treatment if one of
these prefixes appears in _t_e_s_t__s_t_r. For example, if _i_n__s_t_r
contains "XMhello" and _t_e_s_t__s_t_rcontains "xmhello", then
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll returns False.
When the strings to be compared are enumerated values, then
you should probably consider using the representation type
facility of Motif instead of XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll. The
representation type facility of Motif obeys the same string
comparison rules as XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll.
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll is used primarily by programmers writing
their own resource converters.
Page 1 (printed 10/24/98)
XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll((((3333XXXX)))) UUUUNNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV XXXXmmmmeeeeNNNNaaaammmmeeeessssAAAArrrreeeeEEEEqqqquuuuaaaallll((((3333XXXX))))
_i_n__s_t_r Specifies one of the two strings to compare. A
prefix of _X_M, XXXXmmmm, xxxxMMMM, or xxxxmmmm is ignored, as is the
case of letters appearing in the string.
_t_e_s_t__s_t_r Specifies the other string to compare. This
string should not start with the prefix _X_M, XXXXmmmm,
xxxxMMMM, or xxxxmmmm. Also, all letters in the string must
be lowercase letters.
RRRREEEETTTTUUUURRRRNNNN
Returns True if the strings match. Otherwise, it returns
False.
RRRREEEELLLLAAAATTTTEEEEDDDD
XXXXmmmmRRRReeeeppppTTTTyyyyppppeeeeRRRReeeeggggiiiisssstttteeeerrrr(3).
Page 2 (printed 10/24/98)